package cn.itcast.activemq.spring.listener;

import org.springframework.jms.listener.SessionAwareMessageListener;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Session;

public class TopicMessageListener implements SessionAwareMessageListener<MapMessage> {
    @Override
    public void onMessage(MapMessage mapMessage, Session session) throws JMSException {
        System.out.println("======TopicMessageListener======");
        System.out.println("id:"+mapMessage.getInt("id"));
        System.out.println("name:"+mapMessage.getString("name"));
        System.out.println("age:"+mapMessage.getInt("age"));
    }
}
